name: pre-commit run_id: commands[2] env HOME: /home/jenkins env LANG: C.UTF-8 env OLM_TIMER1: 3000 env OLM_TIMER2: 2000 env PATH: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit/bin:/opt/pyenv/bin:/tmp/venv-k8qQ/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin env PIP_DISABLE_PIP_VERSION_CHECK: 1 env PIP_USER: 0 env PYTHONHASHSEED: 161084649 env PYTHONIOENCODING: utf-8 env SSH_AUTH_SOCK: ******************************** env TOX_ENV_DIR: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit env TOX_ENV_NAME: pre-commit env TOX_WORK_DIR: /w/workspace/transportpce-tox-verify-transportpce-master/.tox env VIRTUAL_ENV: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit env __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI: true metadata pid: 3420 cwd: /w/workspace/transportpce-tox-verify-transportpce-master/tests allow: /w/workspace/transportpce-tox-verify-transportpce-master/.tox/pre-commit/bin/*:sh:cpan:sudo:which:fixCIcentOS8reposMirrors.sh cmd: pre-commit run --all-files --show-diff-on-failure exit_code: 1 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Initializing environment for https://github.com/hhatto/autopep8. [INFO] Initializing environment for https://github.com/perltidy/perltidy. [INFO] Initializing environment for https://github.com/koalaman/shellcheck-precommit. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier@4.0.0-alpha.8. [INFO] Initializing environment for https://github.com/adrienverge/yamllint. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/hhatto/autopep8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/perltidy/perltidy. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/adrienverge/yamllint. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... trim trailing whitespace.................................................Passed fix end of files.........................................................Passed check for added large files..............................................Passed check for merge conflicts................................................Passed check for case conflicts.................................................Passed check json...............................................................Passed mixed line ending........................................................Passed Tabs remover.............................................................Passed autopep8.................................................................Failed - hook id: autopep8 - files were modified by this hook perltidy.................................................................Passed ShellCheck v0.11.0.......................................................Passed prettier.................................................................Passed yamllint.................................................................Passed pre-commit hook(s) made changes. If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`. To run `pre-commit` as part of git workflow, use `pre-commit install`. All changes made by hooks: diff --git a/tests/transportpce_tests/tapi/test03_tapi_device_change_notifications.py b/tests/transportpce_tests/tapi/test03_tapi_device_change_notifications.py index e992f5bdb..04da18f9b 100644 --- a/tests/transportpce_tests/tapi/test03_tapi_device_change_notifications.py +++ b/tests/transportpce_tests/tapi/test03_tapi_device_change_notifications.py @@ -235,8 +235,8 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): for mapping in mappings: if mapping.get('logical-connection-point') == logical_connection_point: return ( - mapping.get('port-oper-state') == expected_state and - mapping.get('port-admin-state') == expected_state + mapping.get('port-oper-state') == expected_state and + mapping.get('port-admin-state') == expected_state ) return False @@ -259,8 +259,8 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): for tp in node.get('ietf-network-topology:termination-point', []): if tp.get('tp-id') == tp_id: return ( - tp.get('org-openroadm-common-network:operational-state') == expected_state and - tp.get('org-openroadm-common-network:administrative-state') == expected_state + tp.get('org-openroadm-common-network:operational-state') == expected_state and + tp.get('org-openroadm-common-network:administrative-state') == expected_state ) return False @@ -285,8 +285,8 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): value = names[0].get('value', '') if names else '' if name_fragment in value: return ( - nep.get('operational-state') == expected_oper and - nep.get('administrative-state') == expected_admin + nep.get('operational-state') == expected_oper and + nep.get('administrative-state') == expected_admin ) return False @@ -310,7 +310,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): description=f"{topology_name} to be cleared" ) - @staticmethod def _json_default(obj): if isinstance(obj, Path): @@ -382,7 +381,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): # pylint: disable=consider-using-f-string print("execution of {}".format(self.id().split(".")[-1])) - def _assert_ordm_service_planned(self): response = self._wait_for_ordm_service_state( "serviceEthernet-1", admin='inService', lifecycle='planned', timeout=60 @@ -603,7 +601,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): def test_12_get_service_Ethernet(self): self._assert_ordm_service_planned() - def test_13_get_connectivity_service_Ethernet(self): self._assert_tapi_service_installed() @@ -633,7 +630,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(mapping['port-admin-state'], 'InService', "Administrative State should be 'InService'") - def test_16_check_update_openroadm_topo(self): response = test_utils.get_ietf_network_request('openroadm-topology', 'config') self.assertEqual(response['status_code'], requests.codes.ok) @@ -670,7 +666,8 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(link['org-openroadm-common-network:operational-state'], 'inService') self.assertEqual(link['org-openroadm-common-network:administrative-state'], 'inService') self.assertEqual(nb_updated_link, 2, "Only two xponder-output/input links should have been modified") - self._wait_for_tapi_nep_state('1770bea4-b1da-3b20-abce-7d182c0ec0df', 'XPDR1-NETWORK1', 'DISABLED', 'LOCKED', timeout=45) + self._wait_for_tapi_nep_state('1770bea4-b1da-3b20-abce-7d182c0ec0df', + 'XPDR1-NETWORK1', 'DISABLED', 'LOCKED', timeout=45) def test_17_check_update_tapi_neps(self): self.node_details["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID @@ -696,7 +693,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.node_details["node-id"] = "XPDR-C1-XPDR1+DSR" self.assertEqual(nb_updated_neps, 4, "4 xponder neps (OTS, OTSI_MC, iOTU, eODU) should have been modified") - def test_18_check_update_tapi_links(self): self.tapi_topo["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID response = test_utils.transportpce_api_rpc_request( @@ -716,14 +712,12 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(nb_updated_link, 1, "Only one xponder-output/input bidirectional link should have been modified") - def test_19_check_update_service_Ethernet(self): self._assert_service_degraded() def test_20_check_update_connectivity_service_Ethernet(self): self._assert_tapi_service_degraded() - def test_21_restore_status_line_port_xpdrc(self): self.assertTrue(test_utils.sims_update_cp_port(('xpdrc', self.NODE_VERSION_221), '1/0/1-PLUG-NET', '1', { @@ -737,11 +731,9 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): def test_22_check_update_portmapping_ok(self): self._assert_portmapping_all_in_service("XPDR-C1") - def test_23_check_update_openroadm_topo_ok(self): self._assert_openroadm_topology_all_in_service() - def test_24_check_update_tapi_neps_ok(self): self.node_details["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID # self.node_details["node-id"] = "XPDR-C1-XPDR1+OTSi" @@ -756,11 +748,9 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(nep['administrative-state'], 'UNLOCKED', "Administrative State should be 'UNLOCKED'") - def test_25_check_update_tapi_links_ok(self): self._assert_tapi_links_all_enabled() - def test_26_check_update_service1_ok(self): self._assert_ordm_service_planned() @@ -799,7 +789,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(mapping['port-admin-state'], 'InService', "Administrative State should be 'InService'") - def test_30_check_update_openroadm_topo(self): response = test_utils.get_ietf_network_request('openroadm-topology', 'config') self.assertEqual(response['status_code'], requests.codes.ok) @@ -837,7 +826,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(link['org-openroadm-common-network:administrative-state'], 'inService') self.assertEqual(nb_updated_link, 2, "Only two xponder-output/input links should have been modified") - def test_31_check_update_tapi_neps(self): self.node_details["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID # self.node_details["node-id"] = "ROADM-A1+PHOTONIC_MEDIA" @@ -861,7 +849,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): "Administrative State should be 'UNLOCKED'") self.assertEqual(nb_updated_neps, 2, "Only 2 roadm SRG-PP nep (OTS/MC)should have been modified") - def test_32_check_update_tapi_links(self): self.tapi_topo["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID response = test_utils.transportpce_api_rpc_request( @@ -880,7 +867,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(nb_updated_link, 1, "Only one xponder-output/input link should have been modified") - def test_33_check_update_service_Ethernet(self): self._assert_service_degraded() @@ -902,14 +888,12 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): def test_36_check_update_portmapping_ok(self): self._assert_portmapping_all_in_service("ROADM-A1") - def test_37_check_update_openroadm_topo_ok(self): self._assert_openroadm_topology_all_in_service() def test_38_check_update_tapi_neps_ok(self): self._assert_roadm_a_photonic_media_neps_enabled() - def test_39_check_update_tapi_links_ok(self): self._assert_tapi_links_all_enabled() @@ -947,7 +931,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(mapping['port-admin-state'], 'InService', "Administrative State should be 'InService'") - def test_44_check_update_openroadm_topo(self): response = test_utils.get_ietf_network_request('openroadm-topology', 'config') self.assertEqual(response['status_code'], requests.codes.ok) @@ -984,7 +967,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(link['org-openroadm-common-network:administrative-state'], 'inService') self.assertEqual(nb_updated_link, 2, "Only two xponder-output/input links should have been modified") - def test_45_check_update_tapi_neps(self): self.node_details["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID # self.node_details["node-id"] = "ROADM-A1+PHOTONIC_MEDIA" @@ -1008,11 +990,9 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): "Administrative State should be 'UNLOCKED'") self.assertEqual(nb_updated_neps, 4, "4 roadm NEPS should have been modified (OTS/OMS/MC/OTSI_MC") - def test_46_check_update_tapi_links(self): self.tapi_topo["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID - response = self._wait_until( lambda: test_utils.transportpce_api_rpc_request('tapi-topology', 'get-topology-details', self.tapi_topo), lambda r: r['status_code'] == requests.codes.ok, @@ -1033,7 +1013,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(nb_updated_link, 1, "Only one rdm-rdm link should have been modified") - def test_47_check_update_service_Ethernet(self): self._assert_service_degraded() @@ -1098,7 +1077,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(mapping['port-admin-state'], 'InService', "Administrative State should be 'InService'") - def test_58_check_update_openroadm_topo(self): response = test_utils.get_ietf_network_request('openroadm-topology', 'config') self.assertEqual(response['status_code'], requests.codes.ok) @@ -1131,7 +1109,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(link['org-openroadm-common-network:operational-state'], 'inService') self.assertEqual(link['org-openroadm-common-network:administrative-state'], 'inService') - def test_59_check_update_tapi_neps(self): self.node_details["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID # self.node_details["node-id"] = uuid.UUID(bytes="ROADM-A1+PHOTONIC_MEDIA".bytes) @@ -1155,7 +1132,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): "Administrative State should be 'UNLOCKED'") self.assertEqual(nb_updated_neps, 1, "Only 1 roadm neps OTS should have been modified for SRG2PP") - def test_60_check_update_tapi_links(self): self.tapi_topo["topology-id"] = test_utils.T0_FULL_MULTILAYER_TOPO_UUID response = test_utils.transportpce_api_rpc_request( @@ -1172,7 +1148,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): self.assertEqual(link['operational-state'], 'ENABLED') self.assertEqual(link['administrative-state'], 'UNLOCKED') - def test_61_check_update_service1_ok(self): self._assert_ordm_service_planned() @@ -1364,5 +1339,6 @@ class TestTransportPCEDeviceChangeNotifications(unittest.TestCase): description=f"TAPI service {uuid_value} to disappear" ) + if __name__ == "__main__": unittest.main(verbosity=2)